package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.FndCodingRuleDetailsMapper;
import com.bestow.basic.domain.FndCodingRuleDetails;
import com.bestow.basic.service.IFndCodingRuleDetailsService;

/**
 * 编码规则明细Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-03
 */
@Service
public class FndCodingRuleDetailsServiceImpl implements IFndCodingRuleDetailsService 
{
    @Autowired
    private FndCodingRuleDetailsMapper fndCodingRuleDetailsMapper;

    /**
     * 查询编码规则明细
     * 
     * @param codingRuleLineId 编码规则明细主键
     * @return 编码规则明细
     */
    @Override
    public FndCodingRuleDetails selectFndCodingRuleDetailsByCodingRuleLineId(Long codingRuleLineId)
    {
        return fndCodingRuleDetailsMapper.selectFndCodingRuleDetailsByCodingRuleLineId(codingRuleLineId);
    }

    /**
     * 查询编码规则明细列表
     * 
     * @param fndCodingRuleDetails 编码规则明细
     * @return 编码规则明细
     */
    @Override
    public List<FndCodingRuleDetails> selectFndCodingRuleDetailsList(FndCodingRuleDetails fndCodingRuleDetails)
    {
        return fndCodingRuleDetailsMapper.selectFndCodingRuleDetailsList(fndCodingRuleDetails);
    }

    /**
     * 新增编码规则明细
     * 
     * @param fndCodingRuleDetails 编码规则明细
     * @return 结果
     */
    @Override
    public int insertFndCodingRuleDetails(FndCodingRuleDetails fndCodingRuleDetails)
    {
        fndCodingRuleDetails.setCreateTime(DateUtils.getNowDate());
        return fndCodingRuleDetailsMapper.insertFndCodingRuleDetails(fndCodingRuleDetails);
    }

    /**
     * 修改编码规则明细
     * 
     * @param fndCodingRuleDetails 编码规则明细
     * @return 结果
     */
    @Override
    public int updateFndCodingRuleDetails(FndCodingRuleDetails fndCodingRuleDetails)
    {
        fndCodingRuleDetails.setUpdateTime(DateUtils.getNowDate());
        return fndCodingRuleDetailsMapper.updateFndCodingRuleDetails(fndCodingRuleDetails);
    }

    /**
     * 批量删除编码规则明细
     * 
     * @param codingRuleLineIds 需要删除的编码规则明细主键
     * @return 结果
     */
    @Override
    public int deleteFndCodingRuleDetailsByCodingRuleLineIds(Long[] codingRuleLineIds)
    {
        return fndCodingRuleDetailsMapper.deleteFndCodingRuleDetailsByCodingRuleLineIds(codingRuleLineIds);
    }

    /**
     * 删除编码规则明细信息
     * 
     * @param codingRuleLineId 编码规则明细主键
     * @return 结果
     */
    @Override
    public int deleteFndCodingRuleDetailsByCodingRuleLineId(Long codingRuleLineId)
    {
        return fndCodingRuleDetailsMapper.deleteFndCodingRuleDetailsByCodingRuleLineId(codingRuleLineId);
    }
}
